package com.CmJava.listener;

import com.CmJava.FrameData;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * 类名：MyMouseListener
 * 作用：监听窗口里面发生的鼠标事件
 * 作者：陈铭
 * 日期：2021.02.23
 */
public class MyMouseListener extends MouseAdapter {

    public MyMouseListener() {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        if (FrameData.isAlone) {
            FrameData.getDropThread().suspend();
        }
    }

    @Override
    public void mouseExited(MouseEvent e) {
        if (FrameData.isAlone) {
            FrameData.getDropThread().resume();
        }
    }
}
